package com.imooc.utils;

import com.imooc.domain.Result;

import java.util.Objects;

public class ResultUtil {

    public static Result success(Object objects) {
        Result result = new Result();
        result.setCode(0);
        result.setMsg("成功");
        result.setData(objects);
        return result;
    }

    public static Result success(){
        return success(null);
    }

    public static Result error(Integer code, String msg){
        Result result = new Result();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }
}
